package com.eastfair.imaster.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 弹幕表
 * </p>
 *
 * @author zjn
 * @since 2021-11-10
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("o_bullet_screen")
@ApiModel(value = "BulletScreen", description = "弹幕表")
@AllArgsConstructor
public class BulletScreen extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 中文内容
     */
    @ApiModelProperty(value = "中文内容")
    @Size(max = 256, message = "中文内容长度不能超过256")
    @TableField(value = "content", condition = LIKE)
    @Excel(name = "中文内容")
    private String content;

    /**
     * 英文内容
     */
    @ApiModelProperty(value = "英文内容")
    @Size(max = 256, message = "英文内容长度不能超过256")
    @TableField(value = "en_content", condition = LIKE)
    @Excel(name = "英文内容")
    private String enContent;

    /**
     * 使用主体
     */
    @ApiModelProperty(value = "使用主体")
    @Size(max = 16, message = "使用主体长度不能超过16")
    @TableField(value = "subject_type", condition = LIKE)
    @Excel(name = "使用主体")
    private String subjectType;

    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;


    @Builder
    public BulletScreen(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, String content, String enContent, String subjectType, Integer isEnabled, Integer isDeleted) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.content = content;
        this.enContent = enContent;
        this.subjectType = subjectType;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
    }

}
